package com.xyz.controller;

import com.xyz.service.MessageNoticeService;
import com.xyz.util.dto.DataResult;
import com.xyz.util.dto.LoginInfo;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * author：
 * time: 2025/1/3 0003 18:17
 */
@RestController
@RequestMapping("messageNotice")
public class MessageNoticeController {

    private static final Logger logger = LoggerFactory.getLogger(MessageNoticeController.class);

    @Autowired
    private MessageNoticeService messageNoticeService;

    @PostMapping("selectUnreadMessages")
    public DataResult selectEquipmentTree(
            LoginInfo li
    ) {
        try {
            return messageNoticeService.selectUnreadMessages(li);
        } catch (Exception e) {
            logger.error("selectEquipmentTree", e);
            return DataResult.build9500();
        }
    }

}
